<?php

namespace Yz\modules\Generic;

class Template_Neighbors
    extends \Yz_Template_Native
{

    protected function doRender()
    {
        $v =& $this->value;
        if (array_key_exists('item', $v)) {
            $item = $v['item'];
            if ($item instanceof \Yz_Item_Interface) {

                // fetch item's prev/next
                $v['neighbors'] = $item->neighbors();

                debug($v['neighbors']);
                return parent::doRender();
            }
        }
        // not sensible to include file if no neighbors were found
        return '';
    }

}
